<!-- CREATED FOR A TOOL - DON'T EDIT!! -->


<templates>
	<types>
		<type id="System.String">String</type>
		<type id="System.Int16">Short</type>
		<type id="System.Int32">Integer</type>
		<type id="System.Int64">Long</type>
		<type id="System.Double">Double</type>
		<type id="System.Single">Single</type>
		<type id="System.Decimal">Decimal</type>
		<type id="System.Boolean">Boolean</type>
		<type id="System.DateTime">DateTime</type>
		<type id="System.Byte[]">Blob</type>
		<type id="System.Guid">Guid</type>
		<type id="System.Byte">Byte</type>
	</types>
	<initializes>
		<initialize id="System.String" />
		<initialize id="System.Int16" />
		<initialize id="System.Int32" />
		<initialize id="System.Int64" />
		<initialize id="System.Double" />
		<initialize id="System.Single" />
		<initialize id="System.Decimal" />
		<initialize id="System.Boolean" />
		<initialize id="System.DateTime" />
		<initialize id="System.Byte" />
		<initialize id="System.Byte[]"> = new Blob()</initialize>
		<initialize id="System.Guid"> = Guid.NewGuid()</initialize>
	</initializes>


	<visibility>
		<public>Public</public>
		<private>Private</private>
		<internal>Friend</internal>
		<protected>Protected</protected>
	</visibility>

	<virtual> Overridable</virtual>
	<sealed> NotInheritable</sealed>
	<partial> Partial</partial>

	<properties>

		<field><![CDATA[	Private _{1} As {0} {2}]]></field>

		<property>
<![CDATA[	{0}
	<Field("{1}"{2})> {3}{4} Property {6}() As {5}
		{7}{8}
	End Property]]>
		</property>

		<propertyComments>

			<autoNumberComment>
<![CDATA[''' <summary>
	''' Returns the identifier of the persistent object. Don't set it manually!
	''' </summary>]]>
			</autoNumberComment>

			<identifierComment>
<![CDATA[''' <summary>
	''' Returns the identifier of the persistent object. Mandatory.
	''' </summary>]]>
			</identifierComment>

			<foreignKeyComment>
<![CDATA[''' <summary>
	''' The foreign key connected with another persistent object.
	''' </summary>]]>
			</foreignKeyComment>

			<propertyComment>
<![CDATA[''' <summary>
	''' This property is mapped to the "{0}" field. {1} {2}
	''' </summary>]]>
			</propertyComment>

      <propertyDBComment>
        <![CDATA[''' <summary>
	''' This property is mapped to the "{0}" field. {1} {2}
	''' Storage comment: {3}.
	''' </summary>]]>
      </propertyDBComment>

			<mandatoryComment>Mandatory.</mandatoryComment>
			<lengthComment>Length must be between 0 and {0} characters.</lengthComment>

		</propertyComments>

		<fieldAttribute>
			<allowDBNull>AllowDBNull</allowDBNull>
			<identifier>Identifier</identifier>
			<autoNumber>AutoNumber</autoNumber>
			<persistBehaviours>PersistBehaviours</persistBehaviours>
			<dontInsert>PersistBehaviours.DontInsert</dontInsert>
			<dontUpdate>PersistBehaviours.DontUpdate</dontUpdate>
		</fieldAttribute>

		<getAccessor>
<![CDATA[Get 
			Return _{0}
		End Get]]>
		</getAccessor>

		<setAccessor>
<![CDATA[
		{0}Set(ByVal value As {5}) 
			{1}{2}_{3} = value{4}
		End Set]]>
		</setAccessor>

		<argumentNullException>
<![CDATA[If value Is Nothing Then
				Throw new ArgumentNullException("value", "Value is null.")
			End If  
			]]>
		</argumentNullException>

		<argumentException>
<![CDATA[If value IsNot Nothing AndAlso value.Length > {0} Then
				Throw New ArgumentException("Value length must be between 0 and {0} characters.")
			End If
			]]>
		</argumentException>

		<onRowChanged>
<![CDATA[

				OnRowChanged("{0}")]]>
		</onRowChanged>
	
	</properties>

	<relations>

		<simpleRelation>
      <![CDATA[<Relation("{0}"{1})> _]]>
  </simpleRelation>

		<parentFirst>PersistRelationship:=PersistRelationships.ParentFirst</parentFirst>		
		<childFirst>PersistRelationship:=PersistRelationships.ChildFirst</childFirst>

		<manyToManyRelation>
      <![CDATA[<Relation("{0}", WeakPersistent := GetType({1}), WeakRelations := "{2}")> _]]>
  </manyToManyRelation>

		<objectHolder>
<![CDATA[	{0}
	Private _{2} As ObjectHolder(Of {1}) = New ObjectHolder(Of {1})]]>
		</objectHolder>

		<objectSetHolder>
<![CDATA[	{0}
	Private _{2} As ObjectSetHolder(Of {1}) = New ObjectSetHolder(Of {1})]]>
		</objectSetHolder>

		<propertyObjectHolder>
<![CDATA[	''' <summary>
	''' Specifies the connected "{1}" persistent object.
	''' </summary>
	<XmlIgnore()> Public{0} Property {2}() As {1}
		Get 
			Return _{3}.InnerObject
		End Get
		Set(ByVal value As {4}) 
			_{3}.InnerObject = value
		End Set
	End Property]]>
		</propertyObjectHolder>

		<propertyObjectSetHolder>
<![CDATA[	''' <summary>
	''' Gets and sets a set of connected "{1}" persistent objects.
	''' </summary>
	<XmlIgnore()> Public{0} Property {2}() As ObjectSet(Of {1}) 
		Get
			Return _{3}.InnerObject
		End Get
	End Property]]>
		</propertyObjectSetHolder>

	</relations>

	<persistent>
<![CDATA[#Region "Developer's comment header"
' {0}.vb
' 
' author:    {1}
' copyright: {2}
' 
' history:   {3}, {1}: Created.
'
'
#End Region
#Region "Imports"

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.ComponentModel
Imports System.Xml.Serialization
Imports Chili.Opf3
Imports Chili.Opf3.Relations
{11}

#End Region

' Persistent object for the "{4}" table.
<Serializable()><Persistent("{4}"{5})> Public{6}{7} Class {8}{9}
	{10}
End Class
]]>
	</persistent>

	<persistentUser>
		<![CDATA[#Region "Developer's comment header"
' {0}.vb
' 
' author:    {1}
' copyright: {2}
' 
' history:   {3}, {1}: Created.
'
'
#End Region
#Region "Imports"

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Chili.Opf3
Imports Chili.Opf3.Relations

#End Region

	''' <summary>
	''' Partial Persistent object for the "{4}" table.
	''' </summary>
	Public Partial Class {5}
	End Class
	]]>
	</persistentUser>

	<persistentAttribute>
		<poolSize>PoolSize</poolSize>
		<rights>Rights</rights>

		<persistentRights>
			<load>PersistentRights.Load</load>
			<insert>PersistentRights.Insert</insert>
			<update>PersistentRights.Update</update>
			<delete>PersistentRights.Delete</delete>
			<none>PersistentRights.None</none>
		</persistentRights>
	</persistentAttribute>
	
	<regions>
		<relationRegion>
<![CDATA[
#Region "Relations"

{0}

#End Region
]]>
		</relationRegion>

		<fieldRegion>
<![CDATA[
#Region "Fields"

{0}

#End Region
]]>
		</fieldRegion>
	
		<propertiesRegion>
<![CDATA[
#Region "Properties"

{0}

#End Region
]]>
		</propertiesRegion>
	</regions>

	<interfaces>

		<iDynamicExtensible>
<![CDATA[
#Region "IDynamicExtensible Members"

	Private _unknownfields As IDictionary(Of String, Object) = New Dictionary(Of String, Object)

	''' <summary>
	''' Specifies the unknown fields of the persistent object.
	''' </summary>
	Public Property UnknownFields() As IDictionary(Of String, Object)
		Get
			Return _unknownfields
		End Get
	End Property

#End Region
]]>
		</iDynamicExtensible>
		<iDynamicExtensibleName>IDynamicExtensible</iDynamicExtensibleName>

		<iObjectNotification>
<![CDATA[
#Region "IObjectNotification Members"

	''' <summary>
	''' Invoked by the framework before the persistent object is populated.
	''' </summary>
	''' <param name="e">
	''' Contain information about the state of the persistent object and the
	''' <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
	''' </param>
	Sub OnBeforePopulated(ByVal e As ObjectNotificationEventArgs)
		' Add code here, if required. Leave empty if the event is not required.
	End Sub

	''' <summary>
	''' Invoked by the framework after the object is populated.
	''' </summary>
	''' <param name="e">
	''' Contain information about the state of the persistent object and the
	''' <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
	''' </param>
	Sub OnAfterPopulated(ByVal e As ObjectNotificationEventArgs)
		' Add code here, if required. Leave empty if the event is not required.
	End Sub

	''' <summary>
	''' Invoked by the framework before the object is inserted.
	''' </summary>
	''' <param name="e">
	''' Contain information about the state of the persistent object and the
	''' <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
	''' </param>
	Sub OnBeforeInsert(ByVal e As ObjectNotificationEventArgs)
		' Add code here, if required. Leave empty if the event is not required.
	End Sub

	''' <summary>
	''' Invoked by the framework after the object is inserted.
	''' </summary>
	''' <param name="e">
	''' Contain information about the state of the persistent object and the
	''' <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
	''' </param>
	Sub OnAfterInsert(ByVal e As ObjectNotificationEventArgs)
		' Add code here, if required. Leave empty if the event is not required.
	End Sub

	''' <summary>
	''' Invoked by the framework before the object is updated.
	''' </summary>
	''' <param name="e">
	''' Contain information about the state of the persistent object and the
	''' <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
	''' </param>
	Sub OnBeforeUpdate(ByVal e As ObjectNotificationEventArgs)
		' Add code here, if required. Leave empty if the event is not required.
	End Sub

	''' <summary>
	''' Invoked by the framework after the object is updated.
	''' </summary>
	''' <param name="e">
	''' Contain information about the state of the persistent object and the
	''' <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
	''' </param>
	Sub OnAfterUpdate(ByVal e As ObjectNotificationEventArgs)
		' Add code here, if required. Leave empty if the event is not required.
	End Sub

	''' <summary>
	''' Invoked by the framework before the object is deleted.
	''' </summary>
	''' <param name="e">
	''' Contain information about the state of the persistent object and the
	''' <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
	''' </param>
	Sub OnBeforeDelete(ByVal e As ObjectNotificationEventArgs)
		' Add code here, if required. Leave empty if the event is not required.
	End Sub

	''' <summary>
	''' Invoked by the framework after the object is deleted.
	''' </summary>
	''' <param name="e">
	''' Contain information about the state of the persistent object and the
	''' <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
	''' </param>
	Sub OnAfterDelete(ByVal e As ObjectNotificationEventArgs)
		' Add code here, if required. Leave empty if the event is not required.
	End Sub

	''' <summary>
	''' Invoked by the framework after the object has been marked deleted.
	''' </summary>
	''' <param name="e">
	''' Contain information about the state of the persistent object and the
	''' <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
	''' </param>
	Sub OnBeforeMarkDeleted(ByVal e As ObjectNotificationEventArgs)
		' Add code here, if required. Leave empty if the event is not required.
	End Sub

	''' <summary>
	''' Invoked by the framework after the object has been marked deleted.
	''' </summary>
	''' <param name="e">
	''' Contain information about the state of the persistent object and the
	''' <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
	''' </param>
	Sub OnAfterMarkDeleted(ByVal e As ObjectNotificationEventArgs)
		' Add code here, if required. Leave empty if the event is not required.
	End Sub

#End Region
	]]>
		</iObjectNotification>
		<iObjectNotificationName>IObjectNotification</iObjectNotificationName>

		<iPopulateHelper>
<![CDATA[
#Region "IPopulateHelper Members"

	''' <summary>
	''' Indexer used to populate the persistent object. For additional information of how
	''' to implement the interface look at the
	''' <see cref="Opf3.IPopulateHelper">IPopulateHelper</see> class definition.
	''' </summary>
	''' <value>Returns the value of the requested property.</value>
	''' <param name="propertyName">
	''' Name of the property that's data is retrieved or that is populated with data from
	''' the storage.
	''' </param>
	Default Public Property Item(propertyName As String) As Object
		Get
			Select Case propertyName
{0}
				Case Else
					Throw New NotSupportedException("Property not found.")
			End Select
		End Get
		Set(ByVal value As Object)
			Select Case propertyName
{1}
				Case Else
					Throw New NotSupportedException("Property not found.")
			End Select
		End Set
	End Property

#End Region
]]>
		</iPopulateHelper>
		<setterCase>
<![CDATA[				Case "{0}"
					Me.{0} = CType(value, {1})]]>
		</setterCase>
		<getterCase>
<![CDATA[				Case "{0}"
					return Me.{0}]]>
		</getterCase>
		<iPopulateHelperName>IPopulateHelper</iPopulateHelperName>

		<iSelfContainingObject>
<![CDATA[
#Region "ISelfContainingObject Members"

	Private _objectInfo As ObjectInfo = Nothing

	''' <summary>
	''' Returns the <see cref="Opf3.ObjectInfo">ObjectInfo</see> object that contains all
	''' information required to make the persistent object
	''' <see cref="Opf3.ObjectContext">independent from any ObjectContext</see>.
	''' </summary>
	''' <value>
	''' 	<see cref="Opf3.ObjectInfo">ObjectInfo</see> object that holds the status
	''' information of the persistent object.
	''' </value>
	Property ObjectInfo() As ObjectInfo
		Get
			Return _objectInfo
		End Get
		Set(ByVal value As ObjectInfo)
			_objectInfo = value
		End Set
	End Property

#End Region
]]>
		</iSelfContainingObject>
		<iSelfContainingObjectName>ISelfContainingObject</iSelfContainingObjectName>

		<iNotifyPropertyChanged>
<![CDATA[
#Region "INotifyPropertyChanged Members"

	''' <summary>
	''' Invokes the "PropertyChanged" event if a property has been changed and
	''' somebody subscribed the event.
	''' </summary>
	Private Sub OnRowChanged(ByVal propertyName As String)
		If PropertyChanged IsNot Nothing Then
			RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
		End If
	End Sub

	''' <summary>
	''' Event is fired if a property of the persistent changed.
	''' </summary>
	Public Event PropertyChanged As PropertyChangedEventHandler

#End Region
]]>
		</iNotifyPropertyChanged>
		<iNotifyPropertyChangedName>INotifyPropertyChanged</iNotifyPropertyChangedName>

	</interfaces>
</templates>